// ProjectGenerator.h: interface for the ProjectGenerator class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PROJECTGENERATOR_H__E63ECA2D_DB25_4899_974F_424DE096D8E6__INCLUDED_)
#define AFX_PROJECTGENERATOR_H__E63ECA2D_DB25_4899_974F_424DE096D8E6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Project.h"
#include "singleton.h"
#include "Register.h"

namespace VersionControl
{
	class PVI;
	typedef PVI ProjectVersionInfo;
	class DllExport ProjectGenerator : public RegisterTemplate<INT, VersionControl::ProjectVersionInfo*> 
	{
		DECLARE_SINGLETON(ProjectGenerator);
	protected:
		typedef struct Version{
			TCHAR cFileFormat[256];
			INT nVersion;
		}VERSION;
	public:
		ProjectGenerator();
		virtual ~ProjectGenerator();
		
	public:
		Project* Generate();
		Project* Generate(const CString& strPrjPath, const CString& strPrjName);
		BOOL GetProjectDocument(Project* pPrj);
		BOOL SetProjectManager(Project* pPrj);
	private:
		BOOL InitSupports(Project* pPrj);
		BOOL InitSortProperty(Project * pPrj);
		BOOL InitProject(Project * pPrj);
		BOOL InitVolumeManager(Project* pPrj);
		BOOL InitProjectTemplate(Project* pPrj);
		BOOL SaveProject(Project* pPrj);
		BOOL ReadProject(Project* pPrj, const CString& strPrjPath);
		BOOL CreateProjectDirectory(Project* pPrj);
		BOOL CheckFileExist(Project* pPrj);
	};
}
using namespace VersionControl;
DllExport VersionControl::ProjectGenerator& GetProjectGenerator();
#endif // !defined(AFX_PROJECTGENERATOR_H__E63ECA2D_DB25_4899_974F_424DE096D8E6__INCLUDED_)
